import { service } from '@/utils/axios'

const BASE_URL = '/v1/purchase-order'

// 新增
export function addPurchaseOrderData(data: any): Promise<any> {
  return service({
    url: BASE_URL,
    method: 'post',
    data
  })
}

// 更新
export function updatePurchaseOrderData(code: any, data: any): Promise<any> {
  return service({
    url: `${BASE_URL}/${code}`,
    method: 'put',
    data
  })
}

export function getPurchaseOrderPageList(params: any) {
  return service({
    url: `${BASE_URL}/page`,
    method: 'get',
    params
  })
}

export function getPurchaseOrderDataForm(code: any): Promise<any> {
  return service({
    url: `${BASE_URL}/${code}/form`,
    method: 'get'
  })
}
